load("@rules_rust//bindgen:defs.bzl", "rust_bindgen_library")
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_test")

rust_bindgen_library(
    name = "simple_bindgen",
    bindgen_flags = [
        "--allowlist-function=simple_.*",
        "--allowlist-var=SIMPLE_.*",
    ],
    cc_lib = "//bindgen/simple",
    header = "//bindgen/simple:simple.h",
    wrap_static_fns = True,
)

rust_binary(
    name = "simple_example",
    srcs = ["main.rs"],
    deps = [":simple_bindgen"],
)

rust_test(
    name = "simple_test",
    crate = ":simple_example",
)
